<? if($this->count > 0):?>
	<? foreach($this->results AS $row): ?>
		<? 
		$this->replyForm->getElement('receiver_uid')->setValue($row['user_uid']); 
		$this->replyForm->getElement('title')->setValue('RE: ' . $this->escape($row['title'])); 
		?>
		
		
		<h1><?=$this->translate->_('messages_reading_header')?></h1>
		<br />
		
		<ul class="profile_list">
			<li><span><?=$this->translate->_('messages_reading_title')?></span> <?=$this->escape($row['title'])?></li>
			<li><span><?=$this->translate->_('messages_reading_from')?></span> <?if($row['is_notice'] == 1): echo $this->translate->_('system_author'); else: echo $this->GetAuthor($row['user_uid']); endif;?></li>
			<li><span><?=$this->translate->_('messages_reading_date')?></span> <?=$this->datetime($row['create_date'])?></li>
		</ul>
		
		<br />
		
		<h3><?=$this->translate->_('messages_reading_text')?></h3>
		<p class="message_box"><?=nl2br($this->BBCode($this->escape($row['text'], null, 'utf-8')))?></p>
		<br />
		
		<?if($row['is_notice'] != 1):?>
			<h2><?=$this->translate->_('messages_reading_reply')?></h2>
			<br />
			<?=$this->replyForm?>
		<?endif;?>
		
	<? endforeach; ?>
<? else: ?>
	<h1><?=$this->translate->_('messages_error_header')?></h1>
	
	<p class="notice_bad"><?=$this->translate->_('messages_error_text')?></p>
<? endif; ?>

<p><a href="<?=$this->url(array('controller' => 'messages', 'action' => 'index'), 'messages', true)?>"><?=$this->translate->_('messages_to_inbox')?></a></p>